package org.example;

import redis.clients.jedis.Jedis;

import java.util.HashMap;

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, World!");

        Jedis jedis = new Jedis("127.0.0.1",6379);

//        jedis.sadd("myset1","val1","val2","val3");
//        jedis.sadd("myset2","val4","val5","val6");

        System.out.println(jedis.smembers("myset2"));

        //myset1有myset2没有
        System.out.println(jedis.sdiff("myset1", "myset2"));

        //myset2有myset1没有
        System.out.println(jedis.sdiff("myset2", "myset1"));

        //myset1和myset2所有
        System.out.println(jedis.sunion("myset1", "myset2"));

        //myset1和myset2都有
        System.out.println(jedis.sinter("myset1", "myset2"));


        jedis.close();
    }






}